#ifndef CORE_H
#define CORE_H

#include <string>
#include <vector>
#include <map>
#include <list>
#include <windows.h>
#include <tchar.h>
#include <algorithm>
#include <iostream>
#include <boost/exception/all.hpp>
#include <boost/smart_ptr.hpp>
#include <exception>

/*for different runtimes*/

#ifdef _DEBUG
#define LINK_LIB(DebugLibName, ReleaseLibName) __pragma(comment(lib, DebugLibName))
#else
#define LINK_LIB(DebugLibName, ReleaseLibName) __pragma(comment(lib, ReleaseLibName))
#endif

#ifdef CORE_EXPORTS
#define CORE_API   __declspec( dllexport )
#else
#define CORE_API   __declspec( dllimport )
#endif

#define CORE_DELETE_PTR(ptr)\
    if ((ptr) != 0)\
    {\
        (ptr) = 0;\
    }

namespace Core
{
    class String;
    typedef boost::error_info<struct msg_exception, String> ExceptionMessage;

    struct InvalidFileException : virtual boost::exception, virtual std::exception
    {
    };

    struct InvalidArgsException : virtual boost::exception, virtual std::exception
    {
    };

    struct Timeout : virtual boost::exception, virtual std::exception
    {

    };

    template<typename Type>
    void _CopyMemory(Type* src, Type* dst, const std::size_t sz)
    {
        if (src != 0 && dst !=0)
        {
            memcpy(src, dst, sz * sizeof(Type));
        }
    }

    typedef __int64 Int64;
    typedef unsigned __int64 UInt64;
    typedef unsigned char Byte;
    typedef unsigned int UInt;
    typedef unsigned long ULong;

    enum CompareResult
    {
        COMPARE_LESS = -1,
        COMPARE_GREATER = 1,
        COMPARE_EQUAL = 0,
    };
}

#endif